Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GCP-8646] BigQuery: Add support to Dataset for project_ids with org prefix. #14

Closed
wants to merge 9 commits into from

Conversation

emar-kar
Copy link

@emar-kar emar-kar commented Jul 30, 2019

Addresses #8646

Some nox tests/unittests/pytests failed on my PC. According to the trace its not the fault of my chgs.
I decided to use regular expressions to resolve the issue, but I'm still thinking about over ways to do it. Appreciate any help here.

added support to Dataset for project_ids with org prefix
updated tests to check dataset chgs
@emar-kar emar-kar requested review from IlyaFaer and mf2199 July 30, 2019 14:56
@emar-kar emar-kar changed the title Adding support 2 project ids w org prefix Add support to Dataset for project_ids with org prefix. Jul 30, 2019
@emar-kar emar-kar changed the title Add support to Dataset for project_ids with org prefix. BigQuery: Add support to Dataset for project_ids with org prefix. Jul 30, 2019
@emar-kar emar-kar marked this pull request as ready for review July 30, 2019 14:57
bigquery/google/cloud/bigquery/dataset.py Outdated Show resolved Hide resolved
bigquery/google/cloud/bigquery/dataset.py Show resolved Hide resolved
'e.g. "project.dataset_id", got {}'.format(dataset_id)
'e.g. "project.dataset_id" or, single prefix usage '
'is also permitted e.g. "prefix:project.dataset_id" '
"got {}".format(dataset_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The singe- or double-quote usage should be consistent among multiple lines. I'd suggest using single quotes if the contents must contain double ones. Also, I believe there should be commas before each of the e.g. abbreviations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the usage of quotes and didn't notice any discrepancy. As I see, I added single-quotes on the lines where the contents include double-quotes. Or, did I misunderstand you?
Regarding e.g., I checked some English grammar sources and it is written there that it should be enclosed with commas both sides.

Copy link
Collaborator

@mf2199 mf2199 Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having both, single and double quotes enclosing different lines of the same comment is syntactically right, but having a single quote type looks more intuitive and visually pleasing:

                'When default_project is not set, dataset_id must be a '
                'fully-qualified dataset ID in standard SQL format, '
                'e.g., "project.dataset_id" or, single prefix usage '
                'is also permitted, e.g., "prefix:project.dataset_id" '
                'got {}'.format(dataset_id)

Regarding e.g., commas on both sides is even better.

bigquery/google/cloud/bigquery/dataset.py Outdated Show resolved Hide resolved
@mf2199 mf2199 changed the title BigQuery: Add support to Dataset for project_ids with org prefix. [GCP-8646] BigQuery: Add support to Dataset for project_ids with org prefix. Jul 31, 2019
@emar-kar emar-kar requested a review from mf2199 August 1, 2019 09:56
Copy link
Collaborator

@IlyaFaer IlyaFaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay I think

'e.g. "project.dataset_id", got {}'.format(dataset_id)
'e.g. "project.dataset_id" or, single prefix usage '
'is also permitted e.g. "prefix:project.dataset_id" '
"got {}".format(dataset_id)
Copy link
Collaborator

@mf2199 mf2199 Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having both, single and double quotes enclosing different lines of the same comment is syntactically right, but having a single quote type looks more intuitive and visually pleasing:

                'When default_project is not set, dataset_id must be a '
                'fully-qualified dataset ID in standard SQL format, '
                'e.g., "project.dataset_id" or, single prefix usage '
                'is also permitted, e.g., "prefix:project.dataset_id" '
                'got {}'.format(dataset_id)

Regarding e.g., commas on both sides is even better.

Applying requested chgs.
// Removed description for 'single prefix'.
Complete template change.
minor corrections
pattern rewrote with the '[^.]' and .VERBOSE (due to blacken session)
added test to check extra parts within the string with the prefix
reconf prefix in an existed test
@emar-kar emar-kar closed this Aug 22, 2019
@emar-kar emar-kar deleted the adding-support-2-project_ids-w-org-prefix branch August 26, 2019 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants